<template>
  <el-card >
    <div slot="header" class="clearfix" >
      <span class="bold" style="line-height: 28px;">{{ childTitle }}</span>
      <span style="float:right;">
        <el-button type="primary" size="mini" @click="back">返回</el-button>
      </span>
    </div>
    <slot/>
  </el-card>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: () => ''
    }
  },
  computed: {
    childTitle() {
      return this.title
    }
  },
  methods: {
    back() {
      this.$router.go(-1)
    },
    toList() {
      console.log(this.$route)
      if (this.$route.meta.listPath) {
        this.$router.push(this.$route.meta.listPath)
      } else {
        this.$router.go(-1)
      }
    }
  }
}
</script>

